﻿<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
    CodeFile="UseTypeMaintain.aspx.vb" Inherits="WebForm_SysParam_UseTypeMaintain" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:HiddenField ID="hiUID" runat="server" />
            <asp:HiddenField ID="hiDBName" runat="server" />
           
            <asp:ObjectDataSource ID="dbUserType" runat="server" 
                SelectMethod="GetUserType" 
                TypeName="AssetManage.BBL.UserTypeBBL"
                InsertMethod="InsertUserType" UpdateMethod="UpdateUserType">
                   <UpdateParameters>
                        <asp:Parameter Name="id" Type="String" />
                        <asp:Parameter Name="Name" Type="String" />
                        <asp:Parameter Name="Desc" Type="String" />
                        <asp:ControlParameter ControlID="hiUID" Name="UID" PropertyName="Value" 
                            Type="String" />
                        <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" 
                            Type="String" />
                   </UpdateParameters>
                   <SelectParameters>
                        <asp:ControlParameter ControlID="txtID" ConvertEmptyStringToNull="False" 
                            Name="id" PropertyName="Text" Type="String"  DefaultValue =""/>
                        <asp:ControlParameter ControlID="txtName" ConvertEmptyStringToNull="False" 
                            Name="name" PropertyName="Text" Type="String" DefaultValue =""/>
                        <asp:ControlParameter ControlID="txtDesc" 
                            ConvertEmptyStringToNull="False" Name="Desc" PropertyName="Text" 
                            Type="String" DefaultValue =""/>
                        <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" 
                            Type="String" />
                    </SelectParameters>
                    <InsertParameters>
                        <asp:ControlParameter ControlID="txtIDInsert" Name="id" PropertyName="Text"  ConvertEmptyStringToNull="False" 
                            Type="String" />
                        <asp:ControlParameter ControlID="txtNameInsert" Name="name"  ConvertEmptyStringToNull="False" 
                            PropertyName="Text" Type="String" />
                            <asp:ControlParameter ControlID="txtDescInsert" Name="Desc" PropertyName="Text" ConvertEmptyStringToNull="False"
                            Type="String" />
                        <asp:ControlParameter ControlID="hiUID" Name="UID" PropertyName="Value" 
                            Type="String" />
                        <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" 
                            Type="String" />
                </InsertParameters>
                </asp:ObjectDataSource>
           
            <table border="1" width="900px">
                <tr>
                    <td style="text-align: center"  colspan="6">
                        <asp:Label ID="lblTitle" runat="server" meta:resourcekey="lblTitle" Font-Bold="True"
                            Font-Size="24px"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblID" runat="server" meta:resourcekey="lblID"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtID" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblName" runat="server" meta:resourcekey="lblName"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblDesc" runat="server" meta:resourcekey="lblDesc"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtDesc" runat="server"></asp:TextBox>
                    </td>
                    
                </tr>
                <tr>
                    <td align="center" colspan="6">
                        <asp:Button ID="btnInsert" runat="server" meta:resourcekey="btnInsert" />
                        <asp:Button ID="btnQuery" runat="server" meta:resourcekey="btnQuery" />
                    </td>
                </tr>
                <tr style="vertical-align: text-top">
                    <td colspan="6">
                       
                        <TServerControl:TGridView ID="gvUserType" runat="server" 
                            AllowHoverEffect="False" AllowHoverSelect="False" AllowPaging="True" 
                            AutoGenerateColumns="False" DataSourceID="dbUserType" ShowFooterWhenEmpty="False" 
                            ShowHeaderWhenEmpty="True" SkinID="pager" TotalRowCount="0" Width="900px" DataKeyNames="id">
                            <Columns>
                                    <asp:TemplateField>
                                    <EditItemTemplate>
                                        <asp:Button ID="btnSave" runat="server" CommandName="Update" meta:resourcekey="btnSave"></asp:Button>
                                        <asp:Button ID="btnCancel" runat="server" CommandName="Cancel" meta:resourcekey="btnCancel"></asp:Button>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Button ID="btnEdit" runat="server" CommandName="Edit" meta:resourcekey="btnEdit"></asp:Button>
                                    </ItemTemplate>
                                    </asp:TemplateField>
                                    
                                <asp:BoundField meta:resourcekey="gvID" DataField ="id" ReadOnly ="true" />
                                <asp:BoundField meta:resourcekey="gvName" DataField="name" />
                                <asp:BoundField  meta:resourcekey="gvDesc" DataField="Desc" /> 
                                   
                                <asp:BoundField meta:resourcekey="gvCrtDate" DataField="CrtDate" ReadOnly ="true"  DataFormatString="{0:yyyy/MM/dd HH:mm:ss}" />
                                <asp:BoundField meta:resourcekey="gvCrtName" DataField="CrtName" ReadOnly ="true"  />
                                <asp:BoundField meta:resourcekey="gvModiDate" DataField="ModiDate" ReadOnly ="true" DataFormatString="{0:yyyy/MM/dd HH:mm:ss}" />
                                <asp:BoundField meta:resourcekey="gvModiName" DataField="ModiName" ReadOnly ="true" />
                               
                              
                            </Columns>
                            <EmptyDataTemplate>
                                <asp:Label ID="lblEmpty" runat="server" ForeColor="Red" 
                                    meta:resourcekey="lblEmpty"></asp:Label>
                            </EmptyDataTemplate>
                        </TServerControl:TGridView>
                       
                    </td>
                </tr>
            </table>
            <asp:Panel ID="Panel1" runat="server" BackColor="lightGreen" BorderWidth="1" Style="cursor: move;" Width="600px" Height="120px">
                    <table>
                        <tr>
                            <td>
                                <asp:Label ID="lblIDInsert" runat="server" meta:resourcekey="lblIDInsert"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtIDInsert" runat="server"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Label ID="lblNameInsert" runat="server" meta:resourcekey="lblNameInsert"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtNameInsert" runat="server"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Label ID="lblDescInsert" runat="server" meta:resourcekey="lblDescInsert"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtDescInsert" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="6">
                                <asp:Button ID="btnISave" runat="server" Text="<%$ Resources:Save%>" />
                                <asp:Button ID="btnICancel" runat="server" Text="<%$ Resources:Cancel%>" />
                            </td>
                        </tr>
                    </table>
                  </asp:Panel>        
                  <asp:Button ID="btnDummy" runat="server" Style="display: none" SkinID="null" />
                  <ajaxToolkit:ModalPopupExtender ID="mpSearch" runat="server" TargetControlID="btnInsert" X="20" Y="60"
                  PopupControlID="panel1" CancelControlID="btnICancel" PopupDragHandleControlID="panel1" />

        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
